Inverse Pythagorean theorem